#ifndef LOCATIONINFOWIDGET_H
#define LOCATIONINFOWIDGET_H

extern "C" {
#include <location/location-gps-device.h>
#include <location/location-gpsd-control.h>
}
#include <QObject>

class LocationInfo : public QObject
{
    Q_OBJECT
public:
    LocationInfo(QObject *parent = 0);
    ~LocationInfo();
    void updateDeviceFix(LocationGPSDeviceFix *fix);
    void updateStatus(LocationGPSDeviceStatus status);

private slots:
    static void locationChanged(LocationGPSDevice *device, gpointer userdata);
    static void locationConnected(LocationGPSDevice *device, gpointer userdata);
    static void locationDisconnected(LocationGPSDevice *device, gpointer userdata);

signals:
    void positionChanged(qreal lo, qreal lat);

public:
    qreal longitude;
    qreal latitude;
    QString *status;
    int satellites;
    qreal altitude;
    qreal speed;
    LocationGPSDevice *device;
    LocationGPSDControl *control;
};

#endif // LOCATIONINFOWIDGET_H

